package com.kuang.demo.mapper;

import com.kuang.demo.bean.GoodsBean.GoodsBO.CatAndBrandBO;
import com.kuang.demo.bean.GoodsBean.GoodsVO.GoodsDetailVO;
import com.kuang.demo.bean.GoodsBean.GoodsVO.GoodsListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsMapper {
    /**
     * 商品列表查询
     */
    int selectGoodsTotalById();

    List<GoodsListVO.DataBean.ItemsBean> selectGoodsBySortAndOrder(@Param("sort") String sort, @Param("order") String order);

    List<GoodsListVO.DataBean.ItemsBean> selectGoodsBySortAndOrderAndGoodsSn(@Param("sort") String sort, @Param("order") String order, @Param("goodsSn") String goodsSn);

    List<GoodsListVO.DataBean.ItemsBean> selectGoodsBySortAndOrderAndName(@Param("sort") String sort, @Param("order") String order, @Param("name") String name);

    List<GoodsListVO.DataBean.ItemsBean> selectGoodsBySortAndOrderAndGoodsSnAndName(@Param("sort") String sort, @Param("order") String order, @Param("goodsSn") String goodsSn, @Param("name") String name);

    /**
     * 添加商品标签
     * 标签子类
     * 父类标签
     * 出品商标签
     */
    List<CatAndBrandBO.DataBean.CategoryListBean.ChildrenBean>
    selectCategoryChirldrenById(@Param("id") int id);

    List<CatAndBrandBO.DataBean.CategoryListBean>
    selectCategoryFatherById();

    List<CatAndBrandBO.DataBean.BrandListBean>
    selectBrandList();

    /**
     * 添加商品细节
     * 商品（goods）
     * 详细(specifications)
     * 产品(products)
     * 归因（attributes)
     */

    int selectcategoryIdById(@Param("id") int id);

    List<Integer> selectcategoryIdByCategoryId(@Param("categoryId") int categoryId);

    List<GoodsDetailVO.SpecificationsBean> selectSpecificationsBeanById(@Param("id") int id);

    List<GoodsDetailVO.AttributesBean> selectAttributesBeans(@Param("id") int id);

    List<GoodsDetailVO.ProductsBean> selectProductsBeanById(@Param("id") int id);

    GoodsDetailVO.GoodsBean selectGoodsById(@Param("id") int id);
}
